/**
 * desc: 问卷页面
 */

import request from '@/static/uitls/request.js'

// 问卷接口
const getQuestionList = () => {
	return request({
		url: '/bannner/index',
		method: 'GET'
	})
}

// 问卷-需求条件
const getQuestion = (id) => {
	return request({
		url: '/api/v1/language/question?language_id='+id,
		method: 'GET'
	})
}
// 发布需求 提交问券
const create = (data) => {
	return request({
		url: '/api/v1/language/create',
		method: 'POST',
		data
	})
}


// 获取提交过的需求列表
const getAnswerQuestionList = () => {
	return request({
		url: '/api/v1/user.need/index',
		method: 'POST'
	})
}
//删除已提交过的需求
const getAnswerDelete = (id) => {
	return request({
		url: '/api/v1/user.need/delete?need_id='+id,
		method: 'GET'
	})
}

//添加需求选择语种
const getNeedLanguage = (id) => {
	return request({
		url: '/api/v1/user.need/language',
		method: 'GET'
	})
}

//需求详情
const getNeedDetail = (id) => {
	return request({
		url: '/api/v1/user.need/read?need_id='+id,
		method: 'GET'
	})
}

//更新需求问卷
const editQuestion = (data) => {
	return request({
		url: '/api/v1/language/edit',
		method: 'POST',
		data
	})
}
module.exports = {
	getQuestionList,
	getQuestion,
	create,
	getAnswerQuestionList,
	getAnswerDelete,
	getNeedLanguage,
	getNeedDetail,
	editQuestion
}
